//导入路由模块
import VueRouter from 'vue-router';
// 导入路由组件
import homePage from './components/tabbars/homePage.vue'
import member from './components/tabbars/member.vue'
import search from './components/tabbars/search.vue'
import shopCart from './components/tabbars/shopCart.vue'
import newList from './components/newList/newList.vue'
import newsDetails from './components/newList/newsDetails.vue'
import shareImg from './components/shareImg/imageComponent.vue'
import photoInfo from './components/shareImg/photoInfo.vue'
// 创建路由对象
const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/homePage' },
        { path: '/homePage', component: homePage },
        { path: '/member', component: member },
        { path: '/shopcart', component: shopCart },
        { path: '/search', component: search },
        { path: '/homePage/newList', component: newList },
        //启用props来接收参数
        { path: '/homePage/newList/newsDetails/:id', component: newsDetails, props: true },
        { path: '/homePage/shareImg', component: shareImg },
        { path: '/homePage/photoInfos/:id', component: photoInfo, props: true }
    ],
    //手动设置被激活的路由链接的高亮类名
    linkActiveClass: 'mui-active'
});
export default router